import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/Home'
import Add from '@/components/Add'

Vue.use(Router)

export default new Router({
  mode: 'history',
  routes: [
    {
      path: '/home',
      name: 'home',
      component: Home,
      children: [
        {
          path: 'list',
          name: 'list',
          component: () => import('@/components/List')
        },
        {
          path: 'user',
          name: 'user',
          component: () => import('@/components/User')
        },
        {
          path: 'add',
          name: 'add',
          component: Add
        }
      ]
    }
  ]
})
